import streamlit as st
import model.model as mm
import base64

st.set_page_config(
    page_title="私人定制页面",
    page_icon="🤖"
)
st.title("私人定制页面")
mm.page_config()

st.html("""
        <style>
        #root > div:nth-child(1) > div.withScreencast > div > div > div > section.main.st-emotion-cache-bm2z3a.ea3mdgi8 > div.block-container.st-emotion-cache-13ln4jf.ea3mdgi5 > div > div > div > div:nth-child(1) > div > div > div{
        text-align: center;
        }
        button{
            width:100% !important;
        }
        #root > div:nth-child(1) > div.withScreencast > div > div > div > section.st-emotion-cache-1gv3huu.eczjsme18 > div.st-emotion-cache-6qob1r.eczjsme11 > div.st-emotion-cache-1gwvy71.eczjsme12 > div > div > div > div > div:nth-child(1) > div > div > h1{
        text-align:center;
        }
        #ec8285ab{
            text-align:center;
        }
    </style>
    """)
if "xingge" not in st.session_state:
    st.session_state.xingge = ""
bt = st.button("阳光开朗")
if bt:
    st.session_state.xingge="阳光开朗"
    st.switch_page("pages/aibot.py")
bt1 = st.button("霸道总裁")
if bt1:
    st.session_state.xingge="霸道总裁"
    st.switch_page("pages/aibot.py")
bt2 = st.button("细心体贴")
if bt2:
    st.session_state.xingge="细心体贴"
    st.switch_page("pages/aibot.py")

def main_bg(main_bg):
    main_bg_ext = "png"
    st.markdown(
        f"""
         <style>
         .stApp {{
             background: url(data:image/{main_bg_ext};base64,{base64.b64encode(open(main_bg, "rb").read()).decode()});
             background-size: cover
         }}
         </style>
         """,
        unsafe_allow_html=True
    )

# 调用
main_bg('images/login6.png')